import Vue from 'vue'
import Router from 'vue-router'
import Hello from '@/components/Hello'

Vue.use(Router)

// webpack code splitting 组件懒加载
const Test1 = resolve => require(['@/components/Test1'], resolve)
const Test2 = resolve => require(['@/components/Test2'], resolve)
const Test3 = resolve => require(['@/components/Test3'], resolve)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Hello',
      component: Hello
    },
    {
      path: '/test1',
      name: 'Test1',
      component: Test1
    },
    {
      path: '/3',
      name: 'Test2',
      component: Test2
    },
    {
      path: '/4',
      name: 'Test3',
      component: Test3
    }
  ]
})
